package com.xyq.system.domain.question.es;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

@Data
@Document(indexName = "idx_question")
public class QuestionES {
    @Id
    @Field(type = FieldType.Long)
    private Long questionId ;

    @Field(type = FieldType.Text , analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    private String title ;

    @Field(type = FieldType.Byte)
    private Integer difficulty ;

    @Field(type = FieldType.Integer)
    private Integer timeLimit ; // 时间限制

    @Field(type = FieldType.Integer)
    private Integer spaceLimit ; // 空间限制

    @Field(type = FieldType.Text , analyzer = "ik_max_word" , searchAnalyzer = "ik_max_word")
    private String content ; //题目内容

    @Field(type = FieldType.Text)
    private String questionCase ; // 题目示例

    @Field(type = FieldType.Text)
    private String defaultCode ; // 默认代码块

    @Field(type = FieldType.Text)
    private String mainFuc ;  // 默认main方法

    @Field(type = FieldType.Date , format = DateFormat.date_hour_minute_second)
    private LocalDateTime createTime ;
}
